Shader "Hidden/CRTDiffuse"
{
    Properties
    {
        _MainTex ("Texture", 2D) = "white" {}
        _MaskTex ("Mask Texture", 2D) = "white" {}
        _MaskBlend ("Mask Blending", Range(0,1)) = 0.5
        _MaskSize ("Mask Size", Float) = 12.0
    }
    SubShader
    {
        Pass
        {
            CGPROGRAM
            #pragma vertex vert_img // 使用内置的顶点着色器
            #pragma fragment frag

            #include "UnityCG.cginc"

            uniform sampler2D _MainTex;
            uniform sampler2D _MaskTex;

            uniform float _MaskBlend;
            uniform float _MaskSize;

            fixed4 frag (float4 pos : SV_POSITION, float2 uv : TEXCOORD0) : SV_Target
            {
                fixed4 base = tex2D(_MainTex, uv);
                fixed4 mask = tex2D(_MaskTex, uv * _MaskSize);
                return lerp(base, mask, _MaskBlend);
            }
            ENDCG
        }
    }
}